//
//  DataBaseHandle.h
//  UI20_数据库练习
//
//  Created by dllo on 16/1/5.
//  Copyright © 2016年 yy. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "MZY_PictureModel.h"

typedef NS_ENUM(NSUInteger, SelectType) {
    InTable,
    NotInTable,
    SelectError,
};

@interface DataBaseHandle : NSObject
{
    sqlite3 *dbPoint;
}

+ (instancetype)shareDB;

- (void)openDB;

- (void)createTable;

// 判断当前操作的数据有没有收藏过
- (SelectType)colIsInTable:(MZY_PictureModel *)pic;

// 把内容加到数组里
- (void)insertPic:(MZY_PictureModel *)pic;
// 物理删除
- (void)deletePic:(MZY_PictureModel *)pic;
// 逻辑删除
- (void)updatePic:(MZY_PictureModel *)pic;

// 查询
- (NSMutableArray *)selectAllPic;

@end
